<template>
	<view>
		<text>社区页面</text>
		<button type="primary" @click="showPickerView">{{location}}</button>
		<view>
			<uniCityPicker 
			 :showPicker='showPicker'
			 :pickerValueDefault="pickerValueDefault"
			 :themeColor="'red'"
			 @onChange="change"
			 @onConfirm="confirm"></uniCityPicker>
		</view>
		<!--例： :cityFilter="'500000'" 若cityFilter为空则为全国，500000为重庆市 -->
	</view>
</template>

<script>
	import uniCityPicker from '../../components/uni-cityPicker/uni-cityPicker.vue';
	export default {
		components:{uniCityPicker},
		data() {
			return {
				location:'正在定位中...',
				pickerValueDefault:['重庆','重庆市','奉节县'],
				showPicker: false
				// pickerValueDefault1:[
				// 	{
				// 	  "id": 110101,
				// 	  "level": 3,
				// 	  "name": "东城区",
				// 	  "parentId": 110100
				// 	},
				// 	{
				// 	  "id": 110101,
				// 	  "level": 3,
				// 	  "name": "东城区",
				// 	  "parentId": 110100
				// 	},
				// 	{
				// 	  "id": 110101,
				// 	  "level": 3,
				// 	  "name": "东城区",
				// 	  "parentId": 110100
				// 	},
				// ]
			}
		},
		methods: {
			confirm(e){
				console.log("onConfirm")
				this.location=e.value
			},
			change(e){
				console.log("change:")
				console.log(e.id)
				console.log(e.value)
			},
			showPickerView(){
				console.log("btnbtn")
				uni.navigateTo({
					url:'/pages/test/test'
				})
			}
		}
	}
</script>

<style>

</style>
